package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.model.account.RechargeInfo;
import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.model.account.UserAccountDetail;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import com.atguigu.tingshu.vo.account.RechargeInfoVo;
import com.atguigu.tingshu.vo.user.UserInfoVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

public interface UserAccountService extends IService<UserAccount> {


    /**
     * 初始化用户账单
     * @param userId
     */
    void initUserAccount(Long userId);


    /**
     * 修改用户账户余额
     * @param accountLockVo
     */
    void checkAndDeduct(AccountLockVo accountLockVo);

    /**
     * 根据订单号获取充值信息
     * @param orderNo
     * @return
     */
    RechargeInfo getRechargeInfo(String orderNo);

    /**
     * 充值余额
     * @param rechargeInfoVo
     * @return
     */
    Map<String, String> submitRecharge(RechargeInfoVo rechargeInfoVo);


    /**
     * 用户充值，支付成功后，修改余额
     * @param orderNo
     * @return
     */
    void rechargePaySuccess(String orderNo);

    /**
     * 分页查询当前用户充值记录
     * @param userAccountDetailPage
     * @return
     */
    Page<UserAccountDetail> getUserRechargePage(Page<UserAccountDetail> userAccountDetailPage, String s);
}
